package com.itnoob.handler.impl;

import com.itnoob.domain.Article;
import com.itnoob.handler.ReviewHandler;
import com.itnoob.util.Result;
import org.springframework.stereotype.Component;

/**
 * @author zhoujun
 * @date 2025/3/18 21:11
 */
@Component("IMAGE")
public class ImageReviewHandler implements ReviewHandler {


    @Override
    public Result review(Article article) {
        //进行图片审核 不适当的
        boolean containsInappropriateImage =  check(article.getContent());
        if (containsInappropriateImage){
            return new Result(false,"文章中的图片违规!");
        }else {
            return new Result(true,"图片审核通过");
        }

    }

    private boolean check(String content) {
        System.out.println("已抽取文章的图片链接...");
        System.out.println("检查图片...");
        return false;
    }
}
